import enum
from calibrator.ghzdac.registry import RegistryWrapper


class registry_keys(enum.Enum):
    """
    define default keys
    """
    session_name = 'Zurich Calibration'
    spec_id = 'GPIB Bus - TCPIP0::192.168.1.5::inst0::INSTR'

    LO_server = 'anritsu_server'
    LO_id = 'TCPIP0::192.168.1.240::inst0::INSTR'
    LO_power = 18.0

    # IQWIRING = 'IQ mixer wiring'
    # ANRITSUPOWER = 'Anritsu Power'
    # PULSECARRIERFREQ = 5.0
    # ANRITSUID = 'Anritsu ID'
    # SPECTID = 'GPIB Bus - TCPIP0::192.168.1.5::inst0::INSTR'
    # SCOPEID = 'Sampling Scope ID'
    # SCOPESENSITIVITY = 'Sampling Scope sensitivity'

    # TIMEOFFSET = 'DAC delay for pulse calibration'
    # SETUPTYPES = ['no IQ mixer',
    #                 'DAC A -> mixer I, DAC B -> mixer Q',
    #                 'DAC A -> mixer Q, DAC B -> mixer I']

    # ZERONAME = 'zero'
    # PULSENAME = 'pulse'
    # IQNAME = 'IQ'
    # CHANNELNAMES = ['DAC A', 'DAC B']


def new_registry(cxn, board_name='dev8334', use_default=False):
    """return a dictionary like registry
    """
    reg = RegistryWrapper(
        cxn, ['', registry_keys.session_name.value, board_name])
    if use_default:
        for default_key, default_value in registry_keys.__members__.items():
            reg[default_key] = default_value.value
    return reg
